const path = require('path');
module.exports = {
  entry: './src/index.js',
  mode: "development",
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'jsbridge.js',
    library: 'jsbridge', // 导出变量名
    libraryTarget: 'umd', // 所有的模块定义下都可运行的方式。它将在 CommonJS, AMD 环境下运行，或将模块导出到 global 下的变  量
  },
  module: {
    rules: [{
      test: /\.js$/,
      loader: 'babel-loader',
      exclude: /node_modules/,
    }]
  },
  resolve: {
    alias: {
      '@': path.join(__dirname, './src'),
    }
  },
  devServer: {
    port: 8080,
    proxy: {
      '/wxwork/auth': {
        changeOrigin: true,
        target: "http://180.76.119.169/"
      }
    }
  }
}
